package org.example.controller;

import com.netflix.discovery.DiscoveryManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Aaron
 * @since 2021/9/6 14:03
 * <p>描述：自定义全局异常</p>
 */
@Slf4j
@Controller
@RequestMapping("/actuator")
public class OffLineController {

    @RequestMapping(value = "/offline", produces = "application/json; charset=utf-8")
    @ResponseBody
    public String offLine() {
        log.info("服务下线");
        DiscoveryManager.getInstance().shutdownComponent();
        return "服务下线成功";
    }

}
